<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.prime.com.tr/ui"
	xmlns:t="http://myfaces.apache.org/tomahawk"
	template="../../layout/commonLayout.xhtml">
	<ui:define name="head">
                BIDI BIDI
                </ui:define>
	<ui:define name="content">
		<p:outputPanel id="mainPanel">
			<p:messages globalOnly="true" />
			<p:panel id="panel1"
				rendered="#{publishWSDLBean.state == 0 or publishWSDLBean.state == 1 or publishWSDLBean.state == 2 or publishWSDLBean.state == 3}">
				<h:form id="publishForm" prependId="false">
					<p:panel id="publishPanel">
						<h:outputLabel style="font-weight:bold;color:blue">Publish Name : </h:outputLabel>
						<h:outputText value=" " />
						<p:inputText id="publishName"
							value="#{publishWSDLBean.publishName}" size="30" />
						<p:message for="publishName" id="publishNameMessage" />

					</p:panel>
					<p:panel>
						<h:panelGrid columns="4">
							<h:outputLabel style="font-weight:bold;color:blue">WSDL Location : </h:outputLabel>
							<h:outputText value=" " />
							<p:inputText id="wsdlLocation"
								value="#{publishWSDLBean.wsdlLocation}" size="30" />
							<p:fileUpload
								fileUploadListener="#{publishWSDLBean.handleFileUpload}"
								update="wsdlLocation" />
							<p:message for="wsdlLocation" id="wsdlLocationMessage" />
						</h:panelGrid>
					</p:panel>
					<p:panel>
						<h:outputLabel style="font-weight:bold;color:blue">Request Path For Publish: </h:outputLabel>
						<h:outputText value=" /publish/ " />
						<p:inputText id="requestPath"
							value="#{publishWSDLBean.requestPath}" size="30" />
						<p:message for="requestPath" id="requestPathMessage" />
						<br />
						<h:outputLabel style="font-weight:bold;color:blue">Request Path For Endpoint: </h:outputLabel>
						<h:outputText value=" /service/ " />
						<p:inputText id="requestPathForEndPoint" size="30" readonly="true"
							disabled="true" />
					</p:panel>
					<p:panel>
						<p:commandButton action="#{publishWSDLBean.checkXML}" value="Next"
							update="mainPanel" />
					</p:panel>
					<script type="text/javascript">
					
					jQuery(document).ready(function(){
						jQuery('#requestPath').bind('keyup',function() {
							jQuery('#requestPathForEndPoint').val(jQuery(this).val())
						});
					});
					
					</script>
				</h:form>
				<p:dialog rendered="#{publishWSDLBean.state == 2}" visible="true"
					closeOnEscape="false" onCloseUpdate="mainPanel" draggable="false"
					modal="true" resizable="false" widgetVar="sslDialog" width="640">
					<p:panel>
						<h:outputLabel>This certificate is not in truststore. Do you want to add?</h:outputLabel>
					</p:panel>
					<p:outputPanel>
						<h:outputLabel value="Issued To : "
							style="font-weight:bold;color:blue" />
						<h:outputLabel value="#{publishWSDLBean.certificateInfo.issuedTo}" />
						<br />
						<h:outputLabel value="Issued By : "
							style="font-weight:bold;color:blue" />
						<h:outputLabel value="#{publishWSDLBean.certificateInfo.issuedBy}" />
						<br />
						<h:outputLabel value="Valid From "
							style="font-weight:bold;color:blue" />
						<h:outputLabel
							value="#{publishBasicBean.certificateInfo.notBefore}" />
						<h:outputLabel value=" To " style="font-weight:bold;color:blue" />
						<h:outputLabel value="#{publishWSDLBean.certificateInfo.notAfter}" />
						<br />
					</p:outputPanel>
					<p:panel>
						<h:form>
							<p:commandButton
								action="#{publishWSDLBean.addCertificaToTrustStore}" value="Yes"
								oncomplete="sslDialog.hide()" />
							<p:commandButton action="#{publishWSDLBean.cancelAddCertificate}"
								value="No" oncomplete="sslDialog.hide()" />
						</h:form>
					</p:panel>
				</p:dialog>
				<p:dialog rendered="#{publishWSDLBean.state == 3}" visible="true"
					closeOnEscape="false" onCloseUpdate="mainPanel" draggable="false"
					modal="true" resizable="false" widgetVar="basicAuthDialog"
					width="640">
					<p:panel>
						<h:outputLabel>You must enter valid password to enter this resource.</h:outputLabel>
					</p:panel>
					<h:form>
						<p:outputPanel>
							<h:outputLabel value="Username : "
								style="font-weight:bold;color:blue" />
							<p:inputText value="#{publishWSDLBean.username}" size="30" />
							<br />
							<h:outputLabel value="Password : "
								style="font-weight:bold;color:blue" />
							<p:password value="#{publishWSDLBean.password}" size="30" />
							<br />
						</p:outputPanel>
						<p:panel>
							<p:commandButton action="#{publishWSDLBean.basicAuthCheckURL}"
								update="mainPanel" value="Yes"
								oncomplete="basicAuthDialog.hide()" />
							<p:commandButton type="button" value="Cancel"
								oncomplete="basicAuthDialog.hide()" />
						</p:panel>
					</h:form>
				</p:dialog>
			</p:panel>
			<p:panel id="panel5" rendered="#{publishWSDLBean.state == 4}">
				<h:inputTextarea value="#{publishWSDLBean.contentString}"
					readonly="true" rows="20" cols="60"
					style="overflow-x:scroll;word-wrap:auto" />
				<h:form>
					<h:selectBooleanCheckbox value="#{publishWSDLBean.postAvaiable}"/><h:outputText>POST</h:outputText>
					<br />
					<h:selectBooleanCheckbox value="#{publishWSDLBean.getAvaiable}"/><h:outputText>GET</h:outputText>
					<br />

					<p:panel>
						<p:commandButton action="#{publishWSDLBean.setConfiguration}"
							value="Finish" update="mainPanel" />
					</p:panel>
				</h:form>
			</p:panel>
		</p:outputPanel>
	</ui:define>
</ui:composition>